package com.example.dubbolearnning.consumer.controller;

import java.io.IOException;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.example.dubbolearnning.api.intf.DemoService;

/**
 * <Description> <br>
 * 
 * @author panlong189 <br>
 * @version 1.0 <br>
 * @taskId <br>
 * @CreateDate 2018年5月21日 <br>
 * @since 1.0 <br>
 * @see com.example.dubbolearnning.consumer.controller <br>
 */
@RestController
public class DemoConsumerController {
    @Reference(version = "${dubbo.provider.version}", application = "${dubbo.application.id}",
        url = "dubbo://localhost:20881")
    private DemoService demoService;

    @RequestMapping("/sayHello")
    public String sayHello(@RequestParam String name) throws IOException {
        return demoService.sayHello(name);
    }
}